package com.example.helloword;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ShowActivity extends Activity {

	private TextView textView;
	private Button backButton;
	private Button changeFontButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_show);
		textView = (TextView) findViewById(R.id.textView);
		Bundle bundle = getIntent().getExtras();
		String sex = (String) bundle.get("sex");
		String height = (String) bundle.get("height");
		String width = (String) bundle.get("width");

		String text = (String) textView.getText();
		text = String.format(text, new Object[] { sex, height, width });
		textView.setText(text);

		backButton = (Button) findViewById(R.id.backButton);
		backButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				
//				ShowActivity.this.setResult(RESULT_OK);
//				ShowActivity.this.finish();
				Intent intent = new Intent();
				intent.setClass(ShowActivity.this, ListViewLoader.class);
				startActivity(intent);
			}
		});

		changeFontButton = (Button) findViewById(R.id.changeFontButton);
		changeFontButton.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				textView.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/LUCON.TTF"));
			}
		});

	}

}
